@extends('admin.main')
@section('content')
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">后台设置</strong>
                    /
                    <strong class="am-text-primary am-text-lg">广告</strong>
                    {{--/ <small>H5扩展</small>--}}
                </div>
            </div>
            <hr>
            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <a href="{{$prefix_url}}/create">
                                <button type="button" class="am-btn am-btn-default">
                                    <span class="am-icon-plus"></span> 新增
                                </button>
                            </a>
                        </div>
                    </div>
                </div>
            </div>

            <div class="am-g">
                <div class="am-u-sm-12">
                    <table class="am-table am-table-striped am-table-hover table-main">
                        <thead>
                        <tr>
                            <th class="table-check"><input type="checkbox" /></th>
                            {{--<th class="table-id">ID</th>--}}
                            <th class="table-title">图片</th>
                            <th class="table-type">广告位</th>
                            {{--<th class="table-author am-hide-sm-only">状态</th>--}}
                            <th class="table-date am-hide-sm-only">时间</th>
                            <th class="table-set">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($datas as $data)
                        <tr>
                            <td><input type="checkbox"/></td>
                            {{--<td>{{$data->id}}</td>--}}
                            <td><a href="{{$data->img}}" target="_blank">
                                    <img src="{{$data->img}}" height="30">
                                </a></td>
                            <td><a href="javascript:;">
                                {{$data->getGenreName()}}
                                </a></td>
                            {{--<td></td>--}}
                            <td class="am-hide-sm-only">{{$data->createTime()}}</td>
                            <td>
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <a href="{{$prefix_url}}/{{$data->id}}/edit">
                                            <button class="am-btn am-btn-default
                                                am-btn-xs am-text-secondary">
                                                <span class="am-icon-pencil-square-o"></span>
                                                编辑
                                            </button>
                                        </a>
                                        @if($data->link)
                                            <a href="{{$data->link}}" target="_blank">
                                                <button class="am-btn am-btn-default
                                                am-btn-xs am-text-secondary">
                                                    <span class="am-icon-pencil-square-o"></span>
                                                    链接详情
                                                </button>
                                            </a>
                                        @endif
                                    </div>
                                </div>
                            </td>
                        </tr>
                        @endforeach
                        </tbody>
                    </table>
                    @include('admin.layouts.page')
                </div>
            </div>
        </div>
    </div>
@stop